home *** CD-ROM | disk | FTP | other *** search
Wrap
global gStates, gObjects, gCurKeyList, gWorld, void, gCursorPresent, gHitMaps, sCURSORSPRITE, cNullCast on turnOnObj OBJref if (OBJref = #describe) or voidp(OBJref) then put "this turns on and off all of an object's children -k" put "use syntax: turnOnObj #thermometerObj --passing a symbol" exit end if set thisObj to getaProp(gObjects, OBJref) set parentState to the State of thisObj set myChildren to the Children of thisObj set howmany to count(myChildren) repeat with thisChildRef in myChildren set thisChildObj to getaProp(gObjects, thisChildRef) if parentState = #off then setaProp(thisChildObj, #DisplayState, #false) next repeat end if if getaProp(thisChildObj, #type) = #animator then displayObj(getaProp(thisChildObj, #RefName)) next repeat end if if getaProp(thisChildObj, #type) = #animatorParent then displayObj(getaProp(thisChildObj, #State)) next repeat end if if (getaProp(thisChildObj, #type) <> #Parent) and (getaProp(thisChildObj, #type) <> #Hotrect) then if not voidp(getaProp(thisChildObj, #State)) then MakeDynamic(thisChildRef, #DisplayState, getaProp(thisChildObj, #State)) else alert("this object has no State") end if if listp(getaProp(getaProp(thisChildObj, #cast), getaProp(thisChildObj, #DisplayState))) then set the castNum of sprite getaProp(thisChildObj, #SpriteNum) to getAt(getaProp(getaProp(thisChildObj, #cast), getaProp(thisChildObj, #DisplayState)), 1) next repeat end if set the castNum of sprite getaProp(thisChildObj, #SpriteNum) to getaProp(getaProp(thisChildObj, #cast), getaProp(thisChildObj, #DisplayState)) end if end repeat return parentState end